<h2>Gestion des actualités</h2>

<div class="button-box">
	<?= button_link('admin/posts/new_post', 'Nouvelle actualité', 'add') ?>
	<?= button_link('admin/posts/tags',     'Gérer les tags', 'tag_blue') ?>
</div>

<table class="dataTable">
	<thead>
		<tr>
			<th>Titre</th>
			<th>Posté le</th>
			<th>Posté par</th>
			<th>Publié</th>
			<th>Actions</th>
		</tr>
	</thead>
	<tbody>
		<?php foreach ($posts as $post) { ?>
			<tr id="post_<?= $post->id ?>">
				<td><?= $post->title ?></td>
				<td><?= time_to_str($post->created_at) ?></td>
				<td><?= $post->creator_firstname ?> <?= $post->creator_name ?></td>
				<td class="center"><?= bool_icon($post->online) ?></td>
				<td class="actions">
					<?= details_link($post, 'post_details') ?>
					<?= edit_link($post, 'posts/edit') ?>
					<?= delete_link($post, 'post_delete') ?>
				</td>
			</tr>
		<?php } ?>
	</tbody>
</table>
